package com.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.TrafficrecordsMapper;
import com.pojo.Trafficrecords;
import com.service.TrafficrecordsService;
import com.vo.StopcarmoneyVo;
import com.vo.TrafficrecordsVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TrafficrecordsServiceimpl implements TrafficrecordsService {

    @Resource
    private TrafficrecordsMapper trafficrecordsMapper;
    @Override
    public PageInfo<Trafficrecords> selectTrall(TrafficrecordsVo trafficrecordsVo) {
        PageHelper.startPage(trafficrecordsVo.getPage(),trafficrecordsVo.getLimit());
        List<Trafficrecords> trafficrecords = trafficrecordsMapper.selectTrall(trafficrecordsVo);
        PageInfo<Trafficrecords> pageInfo=new PageInfo<>(trafficrecords);
        return pageInfo;
    }

    @Override
    public int addTrafficreCords(StopcarmoneyVo stopcarmoneyVo) {
        int i = trafficrecordsMapper.addTrafficreCords(stopcarmoneyVo);
        return i;
    }

    @Override
    public int addTraff(Trafficrecords trafficrecords) {
        int i = trafficrecordsMapper.addTraff(trafficrecords);
        return i;
    }
}
